<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>商品管理-增加信息</title>
<script type="text/javascript">
    function addCheck() {
		var pname = document.getElementById("pname");
		var pprice = document.getElementById("pprice");
		var pnum = document.getElementById("pnum");
		var pcategory = document.getElementById("pcategory");
		var pdescription = document.getElementById("pdescription");
	    if(pname.value == ''){
	    	alert("商品名不能为空 ! ");
	    	return false;
	    }else if(pprice.value == ''){
            alert("价格不能为空 ! ");
            return false;
        }else if(pnum.value == ''){
            alert("库存量不能为空 ! ");
            return false;
        }else if(pcategory.value == ''){
            alert("类别不能为空 ! ");
            return false;
        }else if(pdescription.value == ''){
            alert("详细信息不能为空 ! ");
            return false;
        }
    }
</script>
</head>
<body>
    <fieldset>
        <legend style="color: #00f" > <h3 >增加商品信息</h3></legend>
        <form action="/WebStoreSSM/controller/addProductAction" method="post" onsubmit="return addCheck();">
            <table>
                <tr><th colspan="2" style="color: #f00">${addMessage}</th></tr>
                <tr><th>商品名：</th><th><input type="text" name="pname" id="pname"/></th></tr>
                <tr><th>价格：</th><th><input type="text" name="pprice" id="pprice"/></th></tr>
                <tr><th>数量：</th><th><input type="text" name="pnum" id="pnum"/></th></tr>
                <tr><th>类别：</th><th><input type="text" name="pcategory" id="pcategory"/></th></tr>
                <tr><th>详细信息：</th><th><input type="text" name="pdescription" id="pdescription"/></th></tr>
                <tr><th colspan="2" align="center"><input type="submit" value="增加"/>
                                                        <input type="reset" value="重置"/></th></tr>
                <tr><th colspan="2" align="center"><a href="/WebStoreSSM/controller/productsInfo_action">返回商品管理</a></th></tr>
            </table>
        </form>
    
    </fieldset>
</body>
</html>